package cn.jtfadmin.base.lang.common.event;


import cn.jtfadmin.base.lang.enums.EntityEventEnum;

/**
 * 实体删监听器
 * 当实体删除时需要发布此事件
 *
 * @author jtf
 * @since 0.0.1
 */
public class EntityEvent extends AkfhApplicationEvent {


    private EntityEventEnum type;


    /**
     * Create a new {@code ApplicationEvent}.
     *
     * @param source the object on which the event initially occurred or with
     *               which the event is associated (never {@code null})
     * @param type 时间类型
     */
    public EntityEvent(Object source, EntityEventEnum type) {
        super(source);
        this.type = type;

    }

    /**
     * 获取删除的实体类
     *
     * @return
     */
    public Object getEntity() {
        return getSource();
    }

    public EntityEventEnum getType() {
        return type;
    }


}
